package com.jaswine.service;

import com.jaswine.bean.dto.RtnDTO;
import com.jaswine.util.JsonUtil;

import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;

/**
 * @Authror GU-YW
 * @Date 2019/6/11 18:17
 */
public class ServerEncoder implements Encoder.Text<RtnDTO> {

    public String encode(RtnDTO resultInfo) throws EncodeException {
        String res= null;
        try {
            res = JsonUtil.obj2String(resultInfo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return res;

    }


    public void init(EndpointConfig endpointConfig) {

    }


    public void destroy() {

    }
}
